import http from 'wechat-http'
http.baseURL = 'http://124.223.14.236:8060/home'
http.intercept.request = (options) => {
  // 指定默认的头信息
  const defaultHeader = {}
  // 权限认证
  defaultHeader.Token = getApp().token
  // 合并头信息
  options.header = Object.assign({}, defaultHeader, options.header)
  // 拦截器处理后的请求参数
  return options
}
http.intercept.response = (res) => {
  if (res.data.errno === 9998) {
    console.log('未登录，不允许操作！')
  }
  if (res.data.errno === 9997){
    console.log('登录验证失败，请重新登录！')
  }
    return res.data
}
wx.http = http